import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex);
import request from "./actions/request.js"
import index from "./actions/index.js"
import good from "./actions/good.js"
import fav from "./actions/fav.js"
import search from "./actions/search.js"
import user from "./actions/user.js"
import follow from "./actions/follow.js"
import follower from "./actions/follower.js"
import message from "./actions/message.js"
import share from "./actions/share.js"
import mIndex from "./mutations/index.js"


let apiDomain = "",
	wssApiDomain = "";
if (process.env.NODE_ENV === 'development') {
	console.log('开发环境')
	apiDomain = "https://www.fastmock.site/mock/39acd36bd50260472127df16096f1094/uniins";
} else {
	console.log('生产环境')
	apiDomain = "";
	wssApiDomain = "";
}

const store = new Vuex.Store({
	state:{
		apiDomain: apiDomain,
	},
	actions:{
		...request,
		...index,
		...good,
		...fav,
		...search,
		...user,
		...follow,
		...follower,
		...message,
		...share
	},
	mutations:{
		...mIndex
	}
})

export default store;